<?php

class Application_Form_FrmCreateSchedule extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
    }
	function frmSchedule($formsche = null){
		$db = new Application_Model_DbTable_DbGlobal();
		
		$bath= new Zend_Form_Element_Text("batch");
		$this->addElement($bath);
		$bath->setAttribs(array('placeholder' => 'Batch','class'=>'form-control validate[required]'));
		
		$status = new Zend_Form_Element_Select("status");
		$opt_status = array(1=>"Public",0=>"Unpublic");
		$status->setMultiOptions($opt_status);
		$status->setAttribs(array('class'=>'form-control validate[required]'));
		$this->addElement($status);
		
		$valid_date = new Zend_Form_Element_Text("valid_date");
		$this->addElement($valid_date);
		$valid_date->setAttribs(array('placeholder' => 'Click To Choose Approlved Date','class'=>'form-control validate[required]'));
		
		$approve_date = new Zend_Form_Element_Text("approve_date");
		$this->addElement($approve_date);
		$approve_date->setAttribs(array('placeholder' => 'Click To Choose Approlved Date','class'=>'form-control validate[required]'));
		
		$validDate = new Zend_Form_Element_Text("validDate");
		$validDate->setAttribs(array('placeholder' =>"Choose Valid Date",'class'=>'form-control validate[required]'));
		$this->addElement($validDate);
		Application_Form_DateTimePicker::addDateField(array("approve_date","validDate"));
		
		$create_where = new Zend_Form_Element_Text("create_where");
		$create_where->setAttribs(array('value' => 'Phnom Penh','class'=>'form-control validate[required]'));
		$this->addElement($create_where);
		
		$academic_year = new Zend_Form_Element_Text("academic_year");
		$academic_year->setAttribs(array('placeholder' =>"Academic Year","class"=>"form-control hasDatepicker validate[required]"
											,"onChange"=>"getTeacherMon78Filter();getTeacherMon810Filter();getTeacherMon1012Filter();getTeacherMon12Filter();getTeacherMon24Filter();getTeacherMon45Filter();getTeacherMon57Filter();getTeacherMon781Filter();
														  getTeachertur78Filter();getTeachertur810Filter();getTeachertur1012Filter();getTeachertur12Filter();getTeachertur24Filter();getTeachertur45Filter();getTeachertur57Filter();getTeachertur781Filter();
														  getTeacherwed78Filter();getTeacherwed810Filter();getTeacherwed1012Filter();getTeacherwed12Filter();getTeacherwed24Filter();getTeacherwed45Filter();getTeacherwed57Filter();getTeacherwed781Filter();
														  getTeacherthu78Filter();getTeacherthu810Filter();getTeacherthu1012Filter();getTeacherthu12Filter();getTeacherthu24Filter();getTeacherthu45Filter();getTeacherthu57Filter();getTeacherthu781Filter();
														  getTeacherfri78Filter();getTeacherfri810Filter();getTeacherfri1012Filter();getTeacherfri12Filter();getTeacherfri24Filter();getTeacherfri45Filter();getTeacherfri57Filter();getTeacherfri781Filter();
														  getTeachersat78Filter();getTeachersat810Filter();getTeachersat1012Filter();getTeachersat12Filter();getTeachersat24Filter();getTeachersat45Filter();getTeachersat57Filter();getTeachersat781Filter();
														  getTeachersun78Filter();getTeachersun810Filter();getTeachersun1012Filter();getTeachersun12Filter();getTeachersun24Filter();getTeachersun45Filter();getTeachersun57Filter();getTeachersun781Filter();
													
										"));
		
		$level = new Zend_Form_Element_Select("level");
		$opt_level = array(0=>"Please Select Degree",1=>"Bachelor Degree",2=>"Associate Degree");
		$level->setAttribs(array("class"=>"form-control validate[required]"));
		$level->setMultiOptions($opt_level);
		//$level->setValue(0);
		
		$rowsRoom= $db->getGlobalDb('SELECT 
									  r.room_id,
									  r.room_name,
									  f.`floor` 
									FROM
									  tbl_room AS r,
									  tbl_floor AS f 
									WHERE room_name != "" 
									  AND r.`floor_id` = f.`floor_id` 
									ORDER BY room_id ASC ');
		$option_room = array(""=>"Select Room");
		if($rowsRoom) {
			foreach($rowsRoom as $readRoom) $option_room[$readRoom['room_id']]=$readRoom['room_name']."(".$readRoom['floor'].")";
		}
		$room_pri = new Zend_Form_Element_Select("room_pri");
		$room_pri->setMultiOptions($option_room);
		$room_pri->setAttribs(array("class"=>"form-control validate[required]","onChange"=>"roomPrimaryExist();"));
		$room_pri->setValue(0);
		
		$year = new Zend_Form_Element_Select("year");
		$opt_year = array(0=>"Please Select Year",1=>"Year I",2=>"Year II",3=>"Year III",4=>"Year IV");
		$year->setMultiOptions($opt_year);
		$year->setAttribs(array("class"=>"form-control validate[required]" ,"onChange"=>"getSubjectMon78Filter();"));
		
		$semester = new Zend_Form_Element_Select("semester");
		$opt_semster= array(0=>"Pleasse Select Semester",1=>"Semster I",2=>"Semster II");
		$semester->setMultiOptions($opt_semster);
		
		$academic_years = new Zend_Form_Element_Text("academic_years");
		$academic_years->setAttribs(array('placeholder' =>"Academic Year","class"=>"form-control hasDatepicker validate[required]","onblur"=>"getSemester()"));
		$this->addElement($academic_years);
		
		$semesters = new Zend_Form_Element_Select("semesters");
		$opt_semsters= array(0=>"Pleasse Select Semester",1=>"Semster I",2=>"Semster II");
		$semesters->setMultiOptions($opt_semsters);
		$semesters->setValue(0);
		$semesters->setAttribs(array("class"=>"form-control"));
		$this->addElement($semesters);
		
		$semester->setAttribs(array("class"=>"form-control validate[required]","onChange"=>"getTeacherMon78Filter();getTeacherMon810Filter();getTeacherMon1012Filter();getTeacherMon12Filter();getTeacherMon24Filter();getTeacherMon45Filter();getTeacherMon57Filter();getTeacherMon781Filter();
														  getTeachertur78Filter();getTeachertur810Filter();getTeachertur1012Filter();getTeachertur12Filter();getTeachertur24Filter();getTeachertur45Filter();getTeachertur57Filter();getTeachertur781Filter();
														  getTeacherwed78Filter();getTeacherwed810Filter();getTeacherwed1012Filter();getTeacherwed12Filter();getTeacherwed24Filter();getTeacherwed45Filter();getTeacherwed57Filter();getTeacherwed781Filter();
														  getTeacherthu78Filter();getTeacherthu810Filter();getTeacherthu1012Filter();getTeacherthu12Filter();getTeacherthu24Filter();getTeacherthu45Filter();getTeacherthu57Filter();getTeacherthu781Filter();
														  getTeacherfri78Filter();getTeacherfri810Filter();getTeacherfri1012Filter();getTeacherfri12Filter();getTeacherfri24Filter();getTeacherfri45Filter();getTeacherfri57Filter();getTeacherfri781Filter();
														  getTeachersat78Filter();getTeachersat810Filter();getTeachersat1012Filter();getTeachersat12Filter();getTeachersat24Filter();getTeachersat45Filter();getTeachersat57Filter();getTeachersat781Filter();
														  getTeachersun78Filter();getTeachersun810Filter();getTeachersun1012Filter();getTeachersun12Filter();getTeachersun24Filter();getTeachersun45Filter();getTeachersun57Filter();getTeachersun781Filter();
										getSubjectMon78Filter();
									"));
		
		$session = new Zend_Form_Element_Select("session");
		$opt_session = array(0=>"Select Session",1=>"Morning",2=>"After noon",3=>"Evening",4=>"Weekend");
		$session->setMultiOptions($opt_session);
		$session->setAttribs(array("class"=>"form-control validate[required]","onChange"=>"getSecssion();"));
		
		$rowsSubject= $db->getGlobalDb('SELECT 
									  s.`subject_id`,
									  s.`subject_name` 
									FROM
									  tbl_subject AS s,
									  tbl_departments AS dpt 
									WHERE s.`dpt_id` = dpt.`dpt_id`
									  ');
		$option_subject = array(0=>"Select Subject");
		if($rowsSubject) {
			foreach($rowsSubject as $readsubject) $option_subject[$readsubject['subject_id']]=$readsubject['subject_name'];
		}
		//monday
		$subject_mon_7_8= new Zend_Form_Element_Select("subject_mon_7_8");
		$subject_mon_7_8->setMultiOptions($option_subject);
		//$subject_mon_7_8->setValue(0);
		$subject_mon_7_8->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_mon_7_8);
		
		$subject_mon_8_10= new Zend_Form_Element_Select("subject_mon_8_10");
		$subject_mon_8_10->setMultiOptions($option_subject);
		//$subject_mon_8_10->setValue(0);
		$subject_mon_8_10->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_mon_8_10);
		
		$subject_mon_10_12= new Zend_Form_Element_Select("subject_mon_10_12");
		$subject_mon_10_12->setMultiOptions($option_subject);
		//$subject_mon_10_12->setValue(0);
		$subject_mon_10_12->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_mon_10_12);
		
		$subject_mon_1_2= new Zend_Form_Element_Select("subject_mon_1_2");
		$subject_mon_1_2->setMultiOptions($option_subject);
		$subject_mon_1_2->setValue(0);
		$subject_mon_1_2->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_mon_1_2);
		
		$subject_mon_2_4= new Zend_Form_Element_Select("subject_mon_2_4");
		$subject_mon_2_4->setMultiOptions($option_subject);
		//$subject_mon_2_4->setValue(0);
		$subject_mon_2_4->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_mon_2_4);
		
		$subject_mon_4_5= new Zend_Form_Element_Select("subject_mon_4_5");
		$subject_mon_4_5->setMultiOptions($option_subject);
		$subject_mon_4_5->setValue(0);
		$subject_mon_4_5->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_mon_4_5);
		
		$subject_mon_5_7= new Zend_Form_Element_Select("subject_mon_5_7");
		$subject_mon_5_7->setMultiOptions($option_subject);
		$subject_mon_5_7->setValue(0);
		$subject_mon_5_7->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_mon_5_7);
		
		$subject_mon_7_8_1= new Zend_Form_Element_Select("subject_mon_7_8_1");
		$subject_mon_7_8_1->setMultiOptions($option_subject);
		$subject_mon_7_8_1->setValue(0);
		$subject_mon_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_mon_7_8_1);
		
		//tuesday
		
		$subject_tue_7_8= new Zend_Form_Element_Select("subject_tue_7_8");
		$subject_tue_7_8->setMultiOptions($option_subject);
		$subject_tue_7_8->setValue(0);
		$subject_tue_7_8->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_tue_7_8);
		
		$subject_tue_8_10= new Zend_Form_Element_Select("subject_tue_8_10");
		$subject_tue_8_10->setMultiOptions($option_subject);
		$subject_tue_8_10->setValue(0);
		$subject_tue_8_10->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_tue_8_10);
		
		$subject_tue_10_12= new Zend_Form_Element_Select("subject_tue_10_12");
		$subject_tue_10_12->setMultiOptions($option_subject);
		$subject_tue_10_12->setValue(0);
		$subject_tue_10_12->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_tue_10_12);
		
		$subject_tue_1_2= new Zend_Form_Element_Select("subject_tue_1_2");
		$subject_tue_1_2->setMultiOptions($option_subject);
		$subject_tue_1_2->setValue(0);
		$subject_tue_1_2->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_tue_1_2);
		
		$subject_tue_2_4= new Zend_Form_Element_Select("subject_tue_2_4");
		$subject_tue_2_4->setMultiOptions($option_subject);
		$subject_tue_2_4->setValue(0);
		$subject_tue_2_4->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_tue_2_4);
		
		$subject_tue_4_5= new Zend_Form_Element_Select("subject_tue_4_5");
		$subject_tue_4_5->setMultiOptions($option_subject);
		$subject_tue_4_5->setValue(0);
		$subject_tue_4_5->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_tue_4_5);
		
		$subject_tue_5_7= new Zend_Form_Element_Select("subject_tue_5_7");
		$subject_tue_5_7->setMultiOptions($option_subject);
		$subject_tue_5_7->setValue(0);
		$subject_tue_5_7->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_tue_5_7);
		
		$subject_tue_7_8_1= new Zend_Form_Element_Select("subject_tue_7_8_1");
		$subject_tue_7_8_1->setMultiOptions($option_subject);
		$subject_tue_7_8_1->setValue(0);
		$subject_tue_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_tue_7_8_1);
		
		//wednessday
		
		$subject_wed_7_8= new Zend_Form_Element_Select("subject_wed_7_8");
		$subject_wed_7_8->setMultiOptions($option_subject);
		$subject_wed_7_8->setValue(0);
		$subject_wed_7_8->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_wed_7_8);
		
		$subject_wed_8_10= new Zend_Form_Element_Select("subject_wed_8_10");
		$subject_wed_8_10->setMultiOptions($option_subject);
		$subject_wed_8_10->setValue(0);
		$subject_wed_8_10->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_wed_8_10);
		
		$subject_wed_10_12= new Zend_Form_Element_Select("subject_wed_10_12");
		$subject_wed_10_12->setMultiOptions($option_subject);
		$subject_wed_10_12->setValue(0);
		$subject_wed_10_12->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_wed_10_12);
		
		$subject_wed_1_2= new Zend_Form_Element_Select("subject_wed_1_2");
		$subject_wed_1_2->setMultiOptions($option_subject);
		$subject_wed_1_2->setValue(0);
		$subject_wed_1_2->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_wed_1_2);
		
		$subject_wed_2_4= new Zend_Form_Element_Select("subject_wed_2_4");
		$subject_wed_2_4->setMultiOptions($option_subject);
		$subject_wed_2_4->setValue(0);
		$subject_wed_2_4->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_wed_2_4);
		
		$subject_wed_4_5= new Zend_Form_Element_Select("subject_wed_4_5");
		$subject_wed_4_5->setMultiOptions($option_subject);
		$subject_wed_4_5->setValue(0);
		$subject_wed_4_5->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_wed_4_5);
		
		$subject_wed_5_7= new Zend_Form_Element_Select("subject_wed_5_7");
		$subject_wed_5_7->setMultiOptions($option_subject);
		$subject_wed_5_7->setValue(0);
		$subject_wed_5_7->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_wed_5_7);
		
		$subject_wed_7_8_1= new Zend_Form_Element_Select("subject_wed_7_8_1");
		$subject_wed_7_8_1->setMultiOptions($option_subject);
		$subject_wed_7_8_1->setValue(0);
		$subject_wed_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_wed_7_8_1);
		//thuesday
		
		$subject_thu_7_8= new Zend_Form_Element_Select("subject_thu_7_8");
		$subject_thu_7_8->setMultiOptions($option_subject);
		$subject_thu_7_8->setValue(0);
		$subject_thu_7_8->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_thu_7_8);
		
		$subject_thu_8_10= new Zend_Form_Element_Select("subject_thu_8_10");
		$subject_thu_8_10->setMultiOptions($option_subject);
		$subject_thu_8_10->setValue(0);
		$subject_thu_8_10->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_thu_8_10);
		
		$subject_thu_10_12= new Zend_Form_Element_Select("subject_thu_10_12");
		$subject_thu_10_12->setMultiOptions($option_subject);
		$subject_thu_10_12->setValue(0);
		$subject_thu_10_12->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_thu_10_12);
		
		$subject_thu_1_2= new Zend_Form_Element_Select("subject_thu_1_2");
		$subject_thu_1_2->setMultiOptions($option_subject);
		$subject_thu_1_2->setValue(0);
		$subject_thu_1_2->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_thu_1_2);
		
		$subject_thu_2_4= new Zend_Form_Element_Select("subject_thu_2_4");
		$subject_thu_2_4->setMultiOptions($option_subject);
		$subject_thu_2_4->setValue(0);
		$subject_thu_2_4->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_thu_2_4);
		
		$subject_thu_4_5= new Zend_Form_Element_Select("subject_thu_4_5");
		$subject_thu_4_5->setMultiOptions($option_subject);
		$subject_thu_4_5->setValue(0);
		$subject_thu_4_5->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_thu_4_5);
		
		$subject_thu_5_7= new Zend_Form_Element_Select("subject_thu_5_7");
		$subject_thu_5_7->setMultiOptions($option_subject);
		$subject_thu_5_7->setValue(0);
		$subject_thu_5_7->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_thu_5_7);
		
		$subject_thu_7_8_1= new Zend_Form_Element_Select("subject_thu_7_8_1");
		$subject_thu_7_8_1->setMultiOptions($option_subject);
		$subject_thu_7_8_1->setValue(0);
		$subject_thu_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_thu_7_8_1);
		//friday
		
		$subject_fri_7_8= new Zend_Form_Element_Select("subject_fri_7_8");
		$subject_fri_7_8->setMultiOptions($option_subject);
		$subject_fri_7_8->setValue(0);
		$subject_fri_7_8->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_fri_7_8);
		
		$subject_fri_8_10= new Zend_Form_Element_Select("subject_fri_8_10");
		$subject_fri_8_10->setMultiOptions($option_subject);
		$subject_fri_8_10->setValue(0);
		$subject_fri_8_10->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_fri_8_10);
		
		$subject_fri_10_12= new Zend_Form_Element_Select("subject_fri_10_12");
		$subject_fri_10_12->setMultiOptions($option_subject);
		$subject_fri_10_12->setValue(0);
		$subject_fri_10_12->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_fri_10_12);
		
		$subject_fri_1_2= new Zend_Form_Element_Select("subject_fri_1_2");
		$subject_fri_1_2->setMultiOptions($option_subject);
		$subject_fri_1_2->setValue(0);
		$subject_fri_1_2->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_fri_1_2);
		
		$subject_fri_2_4= new Zend_Form_Element_Select("subject_fri_2_4");
		$subject_fri_2_4->setMultiOptions($option_subject);
		$subject_fri_2_4->setValue(0);
		$subject_fri_2_4->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_fri_2_4);
		
		$subject_fri_4_5= new Zend_Form_Element_Select("subject_fri_4_5");
		$subject_fri_4_5->setMultiOptions($option_subject);
		$subject_fri_4_5->setValue(0);
		$subject_fri_4_5->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_fri_4_5);
		
		$subject_fri_5_7= new Zend_Form_Element_Select("subject_fri_5_7");
		$subject_fri_5_7->setMultiOptions($option_subject);
		$subject_fri_5_7->setValue(0);
		$subject_fri_5_7->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_fri_5_7);
		
		$subject_fri_7_8_1= new Zend_Form_Element_Select("subject_fri_7_8_1");
		$subject_fri_7_8_1->setMultiOptions($option_subject);
		$subject_fri_7_8_1->setValue(0);
		$subject_fri_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_fri_7_8_1);
		
		//sutday
		$subject_sat_7_8= new Zend_Form_Element_Select("subject_sat_7_8");
		$subject_sat_7_8->setMultiOptions($option_subject);
		$subject_sat_7_8->setValue(0);
		$subject_sat_7_8->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sat_7_8);
		
		$subject_sat_8_10= new Zend_Form_Element_Select("subject_sat_8_10");
		$subject_sat_8_10->setMultiOptions($option_subject);
		$subject_sat_8_10->setValue(0);
		$subject_sat_8_10->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sat_8_10);
		
		$subject_sat_10_12= new Zend_Form_Element_Select("subject_sat_10_12");
		$subject_sat_10_12->setMultiOptions($option_subject);
		$subject_sat_10_12->setValue(0);
		$subject_sat_10_12->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sat_10_12);
		
		$subject_sat_1_2= new Zend_Form_Element_Select("subject_sat_1_2");
		$subject_sat_1_2->setMultiOptions($option_subject);
		$subject_sat_1_2->setValue(0);
		$subject_sat_1_2->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sat_1_2);
		
		$subject_sat_2_4= new Zend_Form_Element_Select("subject_sat_2_4");
		$subject_sat_2_4->setMultiOptions($option_subject);
		$subject_sat_2_4->setValue(0);
		$subject_sat_2_4->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sat_2_4);
		
		$subject_sat_4_5= new Zend_Form_Element_Select("subject_sat_4_5");
		$subject_sat_4_5->setMultiOptions($option_subject);
		$subject_sat_4_5->setValue(0);
		$subject_sat_4_5->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sat_4_5);
		
		$subject_sat_5_7= new Zend_Form_Element_Select("subject_sat_5_7");
		$subject_sat_5_7->setMultiOptions($option_subject);
		$subject_sat_5_7->setValue(0);
		$subject_sat_5_7->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sat_5_7);
		
		$subject_sat_7_8_1= new Zend_Form_Element_Select("subject_sat_7_8_1");
		$subject_sat_7_8_1->setMultiOptions($option_subject);
		$subject_sat_7_8_1->setValue(0);
		$subject_sat_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sat_7_8_1);
		
		//sunday
		$subject_sun_7_8= new Zend_Form_Element_Select("subject_sun_7_8");
		$subject_sun_7_8->setMultiOptions($option_subject);
		$subject_sun_7_8->setValue(0);
		$subject_sun_7_8->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sun_7_8);
		
		$subject_sun_8_10= new Zend_Form_Element_Select("subject_sun_8_10");
		$subject_sun_8_10->setMultiOptions($option_subject);
		$subject_sun_8_10->setValue(0);
		$subject_sun_8_10->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sun_8_10);
		
		$subject_sun_10_12= new Zend_Form_Element_Select("subject_sun_10_12");
		$subject_sun_10_12->setMultiOptions($option_subject);
		$subject_sun_10_12->setValue(0);
		$subject_sun_10_12->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sun_10_12);
		
		$subject_sun_1_2= new Zend_Form_Element_Select("subject_sun_1_2");
		$subject_sun_1_2->setMultiOptions($option_subject);
		$subject_sun_1_2->setValue(0);
		$subject_sun_1_2->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sun_1_2);
		
		$subject_sun_2_4= new Zend_Form_Element_Select("subject_sun_2_4");
		$subject_sun_2_4->setMultiOptions($option_subject);
		$subject_sun_2_4->setValue(0);
		$subject_sun_2_4->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sun_2_4);
		
		$subject_sun_4_5= new Zend_Form_Element_Select("subject_sun_4_5");
		$subject_sun_4_5->setMultiOptions($option_subject);
		$subject_sun_4_5->setValue(0);
		$subject_sun_4_5->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sun_4_5);
		
		$subject_sun_5_7= new Zend_Form_Element_Select("subject_sun_5_7");
		$subject_sun_5_7->setMultiOptions($option_subject);
		$subject_sun_5_7->setValue(0);
		$subject_sun_5_7->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sun_5_7);
		
		$subject_sun_7_8_1= new Zend_Form_Element_Select("subject_sun_7_8_1");
		$subject_sun_7_8_1->setMultiOptions($option_subject);
		$subject_sun_7_8_1->setValue(0);
		$subject_sun_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>""));
		$this->addElement($subject_sun_7_8_1);
		
		//teacher by time day
		
		$rowsTeacher_mon_7_8= $db->getGlobalDb('SELECT 
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id` 
										  AND tin.`dpt_id` = 5 
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=1
										  AND tadt.`time_id`=1');
		$option_teacher_mon_7_8 = array(""=>"Select Teacher");
		if($rowsTeacher_mon_7_8) {
			foreach($rowsTeacher_mon_7_8 as $teacher_mon_7_8) $option_teacher_mon_7_8[$teacher_mon_7_8['teacher_id']]=$teacher_mon_7_8['teacher_name'];
		}
		$teacher_mon_7_8 = new Zend_Form_Element_Select("teacher_mon_7_8");
		$teacher_mon_7_8->setMultiOptions($option_teacher_mon_7_8);
		$teacher_mon_7_8->setValue(0);
		$teacher_mon_7_8->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistmon78Filter();getSubjectMon78Filter();"));
		$this->addElement($teacher_mon_7_8);
		
		$rowsTeacher_mon_8_10= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=1
										  AND tadt.`time_id`=2');
		$option_teacher_mon_8_10 = array(""=>"Select Techer");
		if($rowsTeacher_mon_8_10) {
			foreach($rowsTeacher_mon_8_10 as $teacher_mon_8_10) $option_teacher_mon_8_10[$teacher_mon_8_10['teacher_id']]=$teacher_mon_8_10['teacher_name'];
		}
		$teacher_mon_8_10 = new Zend_Form_Element_Select("teacher_mon_8_10");
		$teacher_mon_8_10->setMultiOptions($option_teacher_mon_8_10);
		$teacher_mon_8_10->setValue(0);
		$teacher_mon_8_10->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistmon810Filter();getSubjectMon810Filter();"));
		$this->addElement($teacher_mon_8_10);
		
		$rowsTeacher_mon_10_12= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=1
										  AND tadt.`time_id`=3');
		$option_teacher_mon_10_12 = array(""=>"Select Techer");
		if($rowsTeacher_mon_10_12) {
			foreach($rowsTeacher_mon_10_12 as $teacher_mon_10_12) $option_teacher_mon_10_12[$teacher_mon_10_12['teacher_id']]=$teacher_mon_10_12['teacher_name'];
		}
		$teacher_mon_10_12 = new Zend_Form_Element_Select("teacher_mon_10_12");
		$teacher_mon_10_12->setMultiOptions($option_teacher_mon_10_12);
		$teacher_mon_10_12->setValue(0);
		$teacher_mon_10_12->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistmon1012Filter();getSubjectMon1012Filter();"));
		$this->addElement($teacher_mon_10_12);
		
		
		$rowsTeacher_mon_1_2= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=1
										  AND tadt.`time_id`=4');
		$option_teacher_mon_1_2 = array(""=>"Select Techer");
		if($rowsTeacher_mon_1_2) {
			foreach($rowsTeacher_mon_1_2 as $teacher_mon_1_2) $option_teacher_mon_1_2[$teacher_mon_1_2['teacher_id']]=$teacher_mon_1_2['teacher_name'];
		}
		$teacher_mon_1_2 = new Zend_Form_Element_Select("teacher_mon_1_2");
		$teacher_mon_1_2->setMultiOptions($option_teacher_mon_1_2);
		$teacher_mon_1_2->setValue(0);
		$teacher_mon_1_2->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistmon12Filter();getSubjectMon12Filter();"));
		$this->addElement($teacher_mon_1_2);
		
		$rowsTeacher_mon_2_4= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=1
										  AND tadt.`time_id`=5');
		$option_teacher_mon_2_4 = array(""=>"Select Techer");
		if($rowsTeacher_mon_2_4) {
			foreach($rowsTeacher_mon_2_4 as $teacher_mon_2_4) $option_teacher_mon_2_4[$teacher_mon_2_4['teacher_id']]=$teacher_mon_2_4['teacher_name'];
		}
		$teacher_mon_2_4 = new Zend_Form_Element_Select("teacher_mon_2_4");
		$teacher_mon_2_4->setMultiOptions($option_teacher_mon_2_4);
		$teacher_mon_2_4->setValue(0);
		$teacher_mon_2_4->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistmon24Filter();getSubjectMon24Filter();"));
		$this->addElement($teacher_mon_2_4);
		
		$rowsTeacher_mon_4_5= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=1
										  AND tadt.`time_id`=6');
		$option_teacher_mon_4_5 = array(""=>"Select Techer");
		if($rowsTeacher_mon_4_5) {
			foreach($rowsTeacher_mon_4_5 as $teacher_mon_4_5) $option_teacher_mon_4_5[$teacher_mon_4_5['teacher_id']]=$teacher_mon_4_5['teacher_name'];
		}
		$teacher_mon_4_5 = new Zend_Form_Element_Select("teacher_mon_4_5");
		$teacher_mon_4_5->setMultiOptions($option_teacher_mon_4_5);
		$teacher_mon_4_5->setValue(0);
		$teacher_mon_4_5->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistmon45Filter();getSubjectMon45Filter();"));
		$this->addElement($teacher_mon_4_5);
		
		$rowsTeacher_mon_5_7= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=1
										  AND tadt.`time_id`=7');
		$option_teacher_mon_5_7 = array(""=>"Select Techer");
		if($rowsTeacher_mon_5_7) {
			foreach($rowsTeacher_mon_5_7 as $teacher_mon_5_7) $option_teacher_mon_5_7[$teacher_mon_5_7['teacher_id']]=$teacher_mon_5_7['teacher_name'];
		}
		$teacher_mon_5_7 = new Zend_Form_Element_Select("teacher_mon_5_7");
		$teacher_mon_5_7->setMultiOptions($option_teacher_mon_5_7);
		$teacher_mon_5_7->setValue(0);
		$teacher_mon_5_7->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistmon57Filter();getSubjectMon57Filter();"));
		$this->addElement($teacher_mon_5_7);
		
		$rowsTeacher_mon_7_8_1= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=1
										  AND tadt.`time_id`=8');
		$option_teacher_mon_7_8_1 = array(""=>"Select Techer");
		if($rowsTeacher_mon_7_8_1) {
			foreach($rowsTeacher_mon_7_8_1 as $teacher_mon_7_8_1) $option_teacher_mon_7_8_1[$teacher_mon_7_8_1['teacher_id']]=$teacher_mon_7_8_1['teacher_name'];
		}
		$teacher_mon_7_8_1 = new Zend_Form_Element_Select("teacher_mon_7_8_1");
		$teacher_mon_7_8_1->setMultiOptions($option_teacher_mon_7_8_1);
		$teacher_mon_7_8_1->setValue(0);
		$teacher_mon_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistmon781Filter();getSubjectMon781Filter();"));
		$this->addElement($teacher_mon_7_8_1);
		
		// tuesday 
		
		$rowsteacher_tur_7_8= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=2
										  AND tadt.`time_id`=1');
		$option_teacher_tur_7_8 = array(""=>"Select Techer");
		if($rowsteacher_tur_7_8) {
			foreach($rowsteacher_tur_7_8 as $teacher_tur_7_8) $option_teacher_tur_7_8[$teacher_tur_7_8['teacher_id']]=$teacher_tur_7_8['teacher_name'];
		}
		$teacher_tur_7_8 = new Zend_Form_Element_Select("teacher_tur_7_8");
		$teacher_tur_7_8->setMultiOptions($option_teacher_tur_7_8);
		$teacher_tur_7_8->setValue(0);
		$teacher_tur_7_8->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExisttue78Filter();getSubjectTur78Filter();"));
		$this->addElement($teacher_tur_7_8);
		
		$rowsteacher_tur_8_10= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=2
										  AND tadt.`time_id`=2');
		$option_teacher_tur_8_10 = array(""=>"Select Techer");
		if($rowsteacher_tur_8_10) {
			foreach($rowsteacher_tur_8_10 as $teacher_tur_8_10) $option_teacher_tur_8_10[$teacher_tur_8_10['teacher_id']]=$teacher_tur_8_10['teacher_name'];
		}
		$teacher_tur_8_10 = new Zend_Form_Element_Select("teacher_tur_8_10");
		$teacher_tur_8_10->setMultiOptions($option_teacher_tur_8_10);
		$teacher_tur_8_10->setValue(0);
		$teacher_tur_8_10->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExisttue810Filter();getSubjectTur810Filter();"));
		$this->addElement($teacher_tur_8_10);
		
		$rowsteacher_tur_10_12= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=2
										  AND tadt.`time_id`=3');
		$option_teacher_tur_10_12 = array(""=>"Select Techer");
		if($rowsteacher_tur_10_12) {
			foreach($rowsteacher_tur_10_12 as $teacher_tur_10_12) $option_teacher_tur_10_12[$teacher_tur_10_12['teacher_id']]=$teacher_tur_10_12['teacher_name'];
		}
		$teacher_tur_10_12 = new Zend_Form_Element_Select("teacher_tur_10_12");
		$teacher_tur_10_12->setMultiOptions($option_teacher_tur_10_12);
		$teacher_tur_10_12->setValue(0);
		$teacher_tur_10_12->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExisttue1012Filter();getSubjectTur1012Filter();"));
		$this->addElement($teacher_tur_10_12);
		
		
		$rowsteacher_tur_1_2= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=2
										  AND tadt.`time_id`=4');
		$option_teacher_tur_1_2 = array(""=>"Select Techer");
		if($rowsteacher_tur_1_2) {
			foreach($rowsteacher_tur_1_2 as $teacher_tur_1_2) $option_teacher_tur_1_2[$teacher_tur_1_2['teacher_id']]=$teacher_tur_1_2['teacher_name'];
		}
		$teacher_tur_1_2 = new Zend_Form_Element_Select("teacher_tur_1_2");
		$teacher_tur_1_2->setMultiOptions($option_teacher_tur_1_2);
		$teacher_tur_1_2->setValue(0);
		$teacher_tur_1_2->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExisttue12Filter();getSubjectTur12Filter();"));
		$this->addElement($teacher_tur_1_2);
		
		$rowsteacher_tur_2_4= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=2
										  AND tadt.`time_id`=5');
		$option_teacher_tur_2_4 = array(""=>"Select Techer");
		if($rowsteacher_tur_2_4) {
			foreach($rowsteacher_tur_2_4 as $teacher_tur_2_4) $option_teacher_tur_2_4[$teacher_tur_2_4['teacher_id']]=$teacher_tur_2_4['teacher_name'];
		}
		$teacher_tur_2_4 = new Zend_Form_Element_Select("teacher_tur_2_4");
		$teacher_tur_2_4->setMultiOptions($option_teacher_tur_2_4);
		$teacher_tur_2_4->setValue(0);
		$teacher_tur_2_4->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExisttue24Filter();getSubjectTur24Filter();"));
		$this->addElement($teacher_tur_2_4);
		
		$rowsteacher_tur_4_5= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=2
										  AND tadt.`time_id`=6');
		$option_teacher_tur_4_5 = array(""=>"Select Techer");
		if($rowsteacher_tur_4_5) {
			foreach($rowsteacher_tur_4_5 as $teacher_tur_4_5) $option_teacher_tur_4_5[$teacher_tur_4_5['teacher_id']]=$teacher_tur_4_5['teacher_name'];
		}
		$teacher_tur_4_5 = new Zend_Form_Element_Select("teacher_tur_4_5");
		$teacher_tur_4_5->setMultiOptions($option_teacher_tur_4_5);
		$teacher_tur_4_5->setValue(0);
		$teacher_tur_4_5->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExisttue45Filter();getSubjectTur45Filter();"));
		$this->addElement($teacher_tur_4_5);
		
		$rowsteacher_tur_5_7= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=2
										  AND tadt.`time_id`=7');
		$option_teacher_tur_5_7 = array(""=>"Select Techer");
		if($rowsteacher_tur_5_7) {
			foreach($rowsteacher_tur_5_7 as $teacher_tur_5_7) $option_teacher_tur_5_7[$teacher_tur_5_7['teacher_id']]=$teacher_tur_5_7['teacher_name'];
		}
		$teacher_tur_5_7 = new Zend_Form_Element_Select("teacher_tur_5_7");
		$teacher_tur_5_7->setMultiOptions($option_teacher_tur_5_7);
		$teacher_tur_5_7->setValue(0);
		$teacher_tur_5_7->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExisttue57Filter();getSubjectTur57Filter();"));
		$this->addElement($teacher_tur_5_7);
		
		$rowsteacher_tur_7_8_1= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=2
										  AND tadt.`time_id`=8');
		$option_teacher_tur_7_8_1 = array(""=>"Select Techer");
		if($rowsteacher_tur_7_8_1) {
			foreach($rowsteacher_tur_7_8_1 as $teacher_tur_7_8_1) $option_teacher_tur_7_8_1[$teacher_tur_7_8_1['teacher_id']]=$teacher_tur_7_8_1['teacher_name'];
		}
		$teacher_tur_7_8_1 = new Zend_Form_Element_Select("teacher_tur_7_8_1");
		$teacher_tur_7_8_1->setMultiOptions($option_teacher_tur_7_8_1);
		$teacher_tur_7_8_1->setValue(0);
		$teacher_tur_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExisttue781Filter();getSubjectTur781Filter();"));
		$this->addElement($teacher_tur_7_8_1);
		
		// wednessday 
		
		$rowsTeacher_wed_7_8= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=3
										  AND tadt.`time_id`=1');
		$option_teacher_wed_7_8 = array(""=>"Select Techer");
		if($rowsTeacher_wed_7_8) {
			foreach($rowsTeacher_wed_7_8 as $teacher_wed_7_8) $option_teacher_wed_7_8[$teacher_wed_7_8['teacher_id']]=$teacher_wed_7_8['teacher_name'];
		}
		$teacher_wed_7_8 = new Zend_Form_Element_Select("teacher_wed_7_8");
		$teacher_wed_7_8->setMultiOptions($option_teacher_wed_7_8);
		$teacher_wed_7_8->setValue(0);
		$teacher_wed_7_8->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistwed78Filter();getSubjectWed78Filter();"));
		$this->addElement($teacher_wed_7_8);
		
		$rowsTeacher_wed_8_10= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=3
										  AND tadt.`time_id`=2');
		$option_teacher_wed_8_10 = array(""=>"Select Techer");
		if($rowsTeacher_wed_8_10) {
			foreach($rowsTeacher_wed_8_10 as $teacher_wed_8_10) $option_teacher_wed_8_10[$teacher_wed_8_10['teacher_id']]=$teacher_wed_8_10['teacher_name'];
		}
		$teacher_wed_8_10 = new Zend_Form_Element_Select("teacher_wed_8_10");
		$teacher_wed_8_10->setMultiOptions($option_teacher_wed_8_10);
		$teacher_wed_8_10->setValue(0);
		$teacher_wed_8_10->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistwed810Filter();getSubjectWed810Filter();"));
		$this->addElement($teacher_wed_8_10);
		
		$rowsTeacher_wed_10_12= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=3
										  AND tadt.`time_id`=3');
		$option_teacher_wed_10_12 = array(""=>"Select Techer");
		if($rowsTeacher_wed_10_12) {
			foreach($rowsTeacher_wed_10_12 as $teacher_wed_10_12) $option_teacher_wed_10_12[$teacher_wed_10_12['teacher_id']]=$teacher_wed_10_12['teacher_name'];
		}
		$teacher_wed_10_12 = new Zend_Form_Element_Select("teacher_wed_10_12");
		$teacher_wed_10_12->setMultiOptions($option_teacher_wed_10_12);
		$teacher_wed_10_12->setValue(0);
		$teacher_wed_10_12->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistwed1012Filter();getSubjectWed1012Filter();"));
		$this->addElement($teacher_wed_10_12);
		
		
		$rowsTeacher_wed_1_2= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=3
										  AND tadt.`time_id`=4');
		$option_teacher_wed_1_2 = array(""=>"Select Techer");
		if($rowsTeacher_wed_1_2) {
			foreach($rowsTeacher_wed_1_2 as $teacher_wed_1_2) $option_teacher_wed_1_2[$teacher_wed_1_2['teacher_id']]=$teacher_wed_1_2['teacher_name'];
		}
		$teacher_wed_1_2 = new Zend_Form_Element_Select("teacher_wed_1_2");
		$teacher_wed_1_2->setMultiOptions($option_teacher_wed_1_2);
		$teacher_wed_1_2->setValue(0);
		$teacher_wed_1_2->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistwed12Filter();getSubjectWed12Filter();"));
		$this->addElement($teacher_wed_1_2);
		
		$rowsTeacher_wed_2_4= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=3
										  AND tadt.`time_id`=5');
		$option_teacher_wed_2_4 = array(""=>"Select Techer");
		if($rowsTeacher_wed_2_4) {
			foreach($rowsTeacher_wed_2_4 as $teacher_wed_2_4) $option_teacher_wed_2_4[$teacher_wed_2_4['teacher_id']]=$teacher_wed_2_4['teacher_name'];
		}
		$teacher_wed_2_4 = new Zend_Form_Element_Select("teacher_wed_2_4");
		$teacher_wed_2_4->setMultiOptions($option_teacher_wed_2_4);
		$teacher_wed_2_4->setValue(0);
		$teacher_wed_2_4->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistwed24Filter();getSubjectWed24Filter();"));
		$this->addElement($teacher_wed_2_4);
		
		$rowsTeacher_wed_4_5= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=3
										  AND tadt.`time_id`=6');
		$option_teacher_wed_4_5 = array(""=>"Select Techer");
		if($rowsTeacher_wed_4_5) {
			foreach($rowsTeacher_wed_4_5 as $teacher_wed_4_5) $option_teacher_wed_4_5[$teacher_wed_4_5['teacher_id']]=$teacher_wed_4_5['teacher_name'];
		}
		$teacher_wed_4_5 = new Zend_Form_Element_Select("teacher_wed_4_5");
		$teacher_wed_4_5->setMultiOptions($option_teacher_wed_4_5);
		$teacher_wed_4_5->setValue(0);
		$teacher_wed_4_5->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistwed45Filter();getSubjectWed45Filter();"));
		$this->addElement($teacher_wed_4_5);
		
		$rowsTeacher_wed_5_7= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=3
										  AND tadt.`time_id`=7');
		$option_teacher_wed_5_7 = array(""=>"Select Techer");
		if($rowsTeacher_wed_5_7) {
			foreach($rowsTeacher_wed_5_7 as $teacher_wed_5_7) $option_teacher_wed_5_7[$teacher_wed_5_7['teacher_id']]=$teacher_wed_5_7['teacher_name'];
		}
		$teacher_wed_5_7 = new Zend_Form_Element_Select("teacher_wed_5_7");
		$teacher_wed_5_7->setMultiOptions($option_teacher_wed_5_7);
		$teacher_wed_5_7->setValue(0);
		$teacher_wed_5_7->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistwed57Filter();getSubjectWed57Filter();"));
		$this->addElement($teacher_wed_5_7);
		
		$rowsTeacher_wed_7_8_1= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=3
										  AND tadt.`time_id`=8');
		$option_teacher_wed_7_8_1 = array(""=>"Select Techer");
		if($rowsTeacher_wed_7_8_1) {
			foreach($rowsTeacher_wed_7_8_1 as $teacher_wed_7_8_1) $option_teacher_wed_7_8_1[$teacher_wed_7_8_1['teacher_id']]=$teacher_wed_7_8_1['teacher_name'];
		}
		$teacher_wed_7_8_1 = new Zend_Form_Element_Select("teacher_wed_7_8_1");
		$teacher_wed_7_8_1->setMultiOptions($option_teacher_wed_7_8_1);
		$teacher_wed_7_8_1->setValue(0);
		$teacher_wed_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistwed781Filter();getSubjectWed781Filter();"));
		$this->addElement($teacher_wed_7_8_1);
		
		// thurseday 
		$rowsTeacher_thu_7_8= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=4
										  AND tadt.`time_id`=1');
		$option_teacher_thu_7_8 = array(""=>"Select Techer");
		if($rowsTeacher_thu_7_8) {
			foreach($rowsTeacher_thu_7_8 as $teacher_thu_7_8) $option_teacher_thu_7_8[$teacher_thu_7_8['teacher_id']]=$teacher_thu_7_8['teacher_name'];
		}
		$teacher_thu_7_8 = new Zend_Form_Element_Select("teacher_thu_7_8");
		$teacher_thu_7_8->setMultiOptions($option_teacher_thu_7_8);
		$teacher_thu_7_8->setValue(0);
		$teacher_thu_7_8->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistthu78Filter();getSubjectThu78Filter();"));
		$this->addElement($teacher_thu_7_8);
		
		$rowsTeacher_thu_8_10= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=4
										  AND tadt.`time_id`=2');
		$option_teacher_thu_8_10 = array(""=>"Select Techer");
		if($rowsTeacher_thu_8_10) {
			foreach($rowsTeacher_thu_8_10 as $teacher_thu_8_10) $option_teacher_thu_8_10[$teacher_thu_8_10['teacher_id']]=$teacher_thu_8_10['teacher_name'];
		}
		$teacher_thu_8_10 = new Zend_Form_Element_Select("teacher_thu_8_10");
		$teacher_thu_8_10->setMultiOptions($option_teacher_thu_8_10);
		$teacher_thu_8_10->setValue(0);
		$teacher_thu_8_10->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistthu810Filter();getSubjectThu810Filter();"));
		$this->addElement($teacher_thu_8_10);
		
		$rowsTeacher_thu_10_12= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=4
										  AND tadt.`time_id`=3');
		$option_teacher_thu_10_12 = array(""=>"Select Techer");
		if($rowsTeacher_thu_10_12) {
			foreach($rowsTeacher_thu_10_12 as $teacher_thu_10_12) $option_teacher_thu_10_12[$teacher_thu_10_12['teacher_id']]=$teacher_thu_10_12['teacher_name'];
		}
		$teacher_thu_10_12 = new Zend_Form_Element_Select("teacher_thu_10_12");
		$teacher_thu_10_12->setMultiOptions($option_teacher_thu_10_12);
		$teacher_thu_10_12->setValue(0);
		$teacher_thu_10_12->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistthu1012Filter();getSubjectThu1012Filter();"));
		$this->addElement($teacher_thu_10_12);
		
		
		$rowsTeacher_thu_1_2= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=4
										  AND tadt.`time_id`=4');
		$option_teacher_thu_1_2 = array(""=>"Select Techer");
		if($rowsTeacher_thu_1_2) {
			foreach($rowsTeacher_thu_1_2 as $teacher_thu_1_2) $option_teacher_thu_1_2[$teacher_thu_1_2['teacher_id']]=$teacher_thu_1_2['teacher_name'];
		}
		$teacher_thu_1_2 = new Zend_Form_Element_Select("teacher_thu_1_2");
		$teacher_thu_1_2->setMultiOptions($option_teacher_thu_1_2);
		$teacher_thu_1_2->setValue(0);
		$teacher_thu_1_2->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistthu12Filter();getSubjectThu12Filter();"));
		$this->addElement($teacher_thu_1_2);
		
		$rowsTeacher_thu_2_4= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=4
										  AND tadt.`time_id`=5');
		$option_teacher_thu_2_4 = array(""=>"Select Techer");
		if($rowsTeacher_thu_2_4) {
			foreach($rowsTeacher_thu_2_4 as $teacher_thu_2_4) $option_teacher_thu_2_4[$teacher_thu_2_4['teacher_id']]=$teacher_thu_2_4['teacher_name'];
		}
		$teacher_thu_2_4 = new Zend_Form_Element_Select("teacher_thu_2_4");
		$teacher_thu_2_4->setMultiOptions($option_teacher_thu_2_4);
		$teacher_thu_2_4->setValue(0);
		$teacher_thu_2_4->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistthu24Filter();getSubjectThu24Filter();"));
		$this->addElement($teacher_thu_2_4);
		
		$rowsTeacher_thu_4_5= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=4
										  AND tadt.`time_id`=6');
		$option_teacher_thu_4_5 = array(""=>"Select Techer");
		if($rowsTeacher_thu_4_5) {
			foreach($rowsTeacher_thu_4_5 as $teacher_thu_4_5) $option_teacher_thu_4_5[$teacher_thu_4_5['teacher_id']]=$teacher_thu_4_5['teacher_name'];
		}
		$teacher_thu_4_5 = new Zend_Form_Element_Select("teacher_thu_4_5");
		$teacher_thu_4_5->setMultiOptions($option_teacher_thu_4_5);
		$teacher_thu_4_5->setValue(0);
		$teacher_thu_4_5->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistthu45Filter();getSubjectThu45Filter();"));
		$this->addElement($teacher_thu_4_5);
		
		$rowsTeacher_thu_5_7= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=4
										  AND tadt.`time_id`=7');
		$option_teacher_thu_5_7 = array(""=>"Select Techer");
		if($rowsTeacher_thu_5_7) {
			foreach($rowsTeacher_thu_5_7 as $teacher_thu_5_7) $option_teacher_thu_5_7[$teacher_thu_5_7['teacher_id']]=$teacher_thu_5_7['teacher_name'];
		}
		$teacher_thu_5_7 = new Zend_Form_Element_Select("teacher_thu_5_7");
		$teacher_thu_5_7->setMultiOptions($option_teacher_thu_5_7);
		$teacher_thu_5_7->setValue(0);
		$teacher_thu_5_7->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistthu57Filter();getSubjectThu57Filter();"));
		$this->addElement($teacher_thu_5_7);
		
		$rowsTeacher_thu_7_8_1= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=4
										  AND tadt.`time_id`=8');
		$option_teacher_thu_7_8_1 = array(""=>"Select Techer");
		if($rowsTeacher_thu_7_8_1) {
			foreach($rowsTeacher_thu_7_8_1 as $teacher_thu_7_8_1) $option_teacher_thu_7_8_1[$teacher_thu_7_8_1['teacher_id']]=$teacher_thu_7_8_1['teacher_name'];
		}
		$teacher_thu_7_8_1 = new Zend_Form_Element_Select("teacher_thu_7_8_1");
		$teacher_thu_7_8_1->setMultiOptions($option_teacher_thu_7_8_1);
		$teacher_thu_7_8_1->setValue(0);
		$teacher_thu_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistthu781Filter();getSubjectThu781Filter();"));
		$this->addElement($teacher_thu_7_8_1);
		
		// friday
		
		$rowsTeacher_fri_7_8= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=5
										  AND tadt.`time_id`=1');
		$option_teacher_fri_7_8 = array(""=>"Select Techer");
		if($rowsTeacher_fri_7_8) {
			foreach($rowsTeacher_fri_7_8 as $teacher_fri_7_8) $option_teacher_fri_7_8[$teacher_fri_7_8['teacher_id']]=$teacher_fri_7_8['teacher_name'];
		}
		$teacher_fri_7_8 = new Zend_Form_Element_Select("teacher_fri_7_8");
		$teacher_fri_7_8->setMultiOptions($option_teacher_fri_7_8);
		$teacher_fri_7_8->setValue(0);
		$teacher_fri_7_8->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistfri78Filter();getSubjectFri78Filter();"));
		$this->addElement($teacher_fri_7_8);
		
		$rowsTeacher_fri_8_10= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=5
										  AND tadt.`time_id`=2');
		$option_teacher_fri_8_10 = array(""=>"Select Techer");
		if($rowsTeacher_fri_8_10) {
			foreach($rowsTeacher_fri_8_10 as $teacher_fri_8_10) $option_teacher_fri_8_10[$teacher_fri_8_10['teacher_id']]=$teacher_fri_8_10['teacher_name'];
		}
		$teacher_fri_8_10 = new Zend_Form_Element_Select("teacher_fri_8_10");
		$teacher_fri_8_10->setMultiOptions($option_teacher_fri_8_10);
		$teacher_fri_8_10->setValue(0);
		$teacher_fri_8_10->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistfri810Filter();getSubjectFri810Filter();"));
		$this->addElement($teacher_fri_8_10);
		
		$rowsTeacher_fri_10_12= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=5
										  AND tadt.`time_id`=3');
		$option_teacher_fri_10_12 = array(""=>"Select Techer");
		if($rowsTeacher_fri_10_12) {
			foreach($rowsTeacher_fri_10_12 as $teacher_fri_10_12) $option_teacher_fri_10_12[$teacher_fri_10_12['teacher_id']]=$teacher_fri_10_12['teacher_name'];
		}
		$teacher_fri_10_12 = new Zend_Form_Element_Select("teacher_fri_10_12");
		$teacher_fri_10_12->setMultiOptions($option_teacher_fri_10_12);
		$teacher_fri_10_12->setValue(0);
		$teacher_fri_10_12->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistfri1012Filter();getSubjectFri1012Filter();"));
		$this->addElement($teacher_fri_10_12);
		
		
		$rowsTeacher_fri_1_2= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=5
										  AND tadt.`time_id`=4');
		$option_teacher_fri_1_2 = array(""=>"Select Techer");
		if($rowsTeacher_fri_1_2) {
			foreach($rowsTeacher_fri_1_2 as $teacher_fri_1_2) $option_teacher_fri_1_2[$teacher_fri_1_2['teacher_id']]=$teacher_fri_1_2['teacher_name'];
		}
		$teacher_fri_1_2 = new Zend_Form_Element_Select("teacher_fri_1_2");
		$teacher_fri_1_2->setMultiOptions($option_teacher_fri_1_2);
		$teacher_fri_1_2->setValue(0);
		$teacher_fri_1_2->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistfri12Filter();getSubjectFri12Filter();"));
		$this->addElement($teacher_fri_1_2);
		
		$rowsTeacher_fri_2_4= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=5
										  AND tadt.`time_id`=5');
		$option_teacher_fri_2_4 = array(""=>"Select Techer");
		if($rowsTeacher_fri_2_4) {
			foreach($rowsTeacher_fri_2_4 as $teacher_fri_2_4) $option_teacher_fri_2_4[$teacher_fri_2_4['teacher_id']]=$teacher_fri_2_4['teacher_name'];
		}
		$teacher_fri_2_4 = new Zend_Form_Element_Select("teacher_fri_2_4");
		$teacher_fri_2_4->setMultiOptions($option_teacher_fri_2_4);
		$teacher_fri_2_4->setValue(0);
		$teacher_fri_2_4->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistfri24Filter();getSubjectFri24Filter();"));
		$this->addElement($teacher_fri_2_4);
		
		$rowsTeacher_fri_4_5= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=5
										  AND tadt.`time_id`=6');
		$option_teacher_fri_4_5 = array(""=>"Select Techer");
		if($rowsTeacher_fri_4_5) {
			foreach($rowsTeacher_fri_4_5 as $teacher_fri_4_5) $option_teacher_fri_4_5[$teacher_fri_4_5['teacher_id']]=$teacher_fri_4_5['teacher_name'];
		}
		$teacher_fri_4_5 = new Zend_Form_Element_Select("teacher_fri_4_5");
		$teacher_fri_4_5->setMultiOptions($option_teacher_fri_4_5);
		$teacher_fri_4_5->setValue(0);
		$teacher_fri_4_5->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistfri45Filter();getSubjectFri45Filter();"));
		$this->addElement($teacher_fri_4_5);
		
		$rowsTeacher_fri_5_7= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=5
										  AND tadt.`time_id`=7');
		$option_teacher_fri_5_7 = array(""=>"Select Techer");
		if($rowsTeacher_fri_5_7) {
			foreach($rowsTeacher_fri_5_7 as $teacher_fri_5_7) $option_teacher_fri_5_7[$teacher_fri_5_7['teacher_id']]=$teacher_fri_5_7['teacher_name'];
		}
		$teacher_fri_5_7 = new Zend_Form_Element_Select("teacher_fri_5_7");
		$teacher_fri_5_7->setMultiOptions($option_teacher_fri_5_7);
		$teacher_fri_5_7->setValue(0);
		$teacher_fri_5_7->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistfri57Filter();getSubjectFri57Filter();"));
		$this->addElement($teacher_fri_5_7);
		
		$rowsTeacher_fri_7_8_1= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=5
										  AND tadt.`time_id`=8');
		$option_teacher_fri_7_8_1 = array(""=>"Select Techer");
		if($rowsTeacher_fri_7_8_1) {
			foreach($rowsTeacher_fri_7_8_1 as $teacher_fri_7_8_1) $option_teacher_fri_7_8_1[$teacher_fri_7_8_1['teacher_id']]=$teacher_fri_7_8_1['teacher_name'];
		}
		$teacher_fri_7_8_1 = new Zend_Form_Element_Select("teacher_fri_7_8_1");
		$teacher_fri_7_8_1->setMultiOptions($option_teacher_fri_7_8_1);
		$teacher_fri_7_8_1->setValue(0);
		$teacher_fri_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistfri781Filter();getSubjectFri781Filter();"));
		$this->addElement($teacher_fri_7_8_1);
		
		//satturday
		
		$rowsTeacher_sat_7_8= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=6
										  AND tadt.`time_id`=1');
		$option_teacher_sat_7_8 = array(""=>"Select Techer");
		if($rowsTeacher_sat_7_8) {
			foreach($rowsTeacher_sat_7_8 as $teacher_sat_7_8) $option_teacher_sat_7_8[$teacher_sat_7_8['teacher_id']]=$teacher_sat_7_8['teacher_name'];
		}
		$teacher_sat_7_8 = new Zend_Form_Element_Select("teacher_sat_7_8");
		$teacher_sat_7_8->setMultiOptions($option_teacher_sat_7_8);
		$teacher_sat_7_8->setValue(0);
		$teacher_sat_7_8->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsat78Filter();getSubjectSat78Filter();"));
		$this->addElement($teacher_sat_7_8);
		
		$rowsTeacher_sat_8_10= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=6
										  AND tadt.`time_id`=2');
		$option_teacher_sat_8_10 = array(""=>"Select Techer");
		if($rowsTeacher_sat_8_10) {
			foreach($rowsTeacher_sat_8_10 as $teacher_sat_8_10) $option_teacher_sat_8_10[$teacher_sat_8_10['teacher_id']]=$teacher_sat_8_10['teacher_name'];
		}
		$teacher_sat_8_10 = new Zend_Form_Element_Select("teacher_sat_8_10");
		$teacher_sat_8_10->setMultiOptions($option_teacher_sat_8_10);
		$teacher_sat_8_10->setValue(0);
		$teacher_sat_8_10->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsat810Filter();getSubjectSat810Filter();"));
		$this->addElement($teacher_sat_8_10);
		
		$rowsTeacher_sat_10_12= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=6
										  AND tadt.`time_id`=3');
		$option_teacher_sat_10_12 = array(""=>"Select Techer");
		if($rowsTeacher_sat_10_12) {
			foreach($rowsTeacher_sat_10_12 as $teacher_sat_10_12) $option_teacher_sat_10_12[$teacher_sat_10_12['teacher_id']]=$teacher_sat_10_12['teacher_name'];
		}
		$teacher_sat_10_12 = new Zend_Form_Element_Select("teacher_sat_10_12");
		$teacher_sat_10_12->setMultiOptions($option_teacher_sat_10_12);
		$teacher_sat_10_12->setValue(0);
		$teacher_sat_10_12->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsat1012Filter();getSubjectSat1012Filter();"));
		$this->addElement($teacher_sat_10_12);
		
		
		$rowsTeacher_sat_1_2= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=6
										  AND tadt.`time_id`=4');
		$option_teacher_sat_1_2 = array(""=>"Select Techer");
		if($rowsTeacher_sat_1_2) {
			foreach($rowsTeacher_sat_1_2 as $teacher_sat_1_2) $option_teacher_sat_1_2[$teacher_sat_1_2['teacher_id']]=$teacher_sat_1_2['teacher_name'];
		}
		$teacher_sat_1_2 = new Zend_Form_Element_Select("teacher_sat_1_2");
		$teacher_sat_1_2->setMultiOptions($option_teacher_sat_1_2);
		$teacher_sat_1_2->setValue(0);
		$teacher_sat_1_2->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsat12Filter();getSubjectSat12Filter();"));
		$this->addElement($teacher_sat_1_2);
		
		$rowsTeacher_sat_2_4= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=6
										  AND tadt.`time_id`=5');
		$option_teacher_sat_2_4 = array(""=>"Select Techer");
		if($rowsTeacher_sat_2_4) {
			foreach($rowsTeacher_sat_2_4 as $teacher_sat_2_4) $option_teacher_sat_2_4[$teacher_sat_2_4['teacher_id']]=$teacher_sat_2_4['teacher_name'];
		}
		$teacher_sat_2_4 = new Zend_Form_Element_Select("teacher_sat_2_4");
		$teacher_sat_2_4->setMultiOptions($option_teacher_sat_2_4);
		$teacher_sat_2_4->setValue(0);
		$teacher_sat_2_4->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsat24Filter();getSubjectSat24Filter();"));
		$this->addElement($teacher_sat_2_4);
		
		$rowsTeacher_sat_4_5= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=6
										  AND tadt.`time_id`=6');
		$option_teacher_sat_4_5 = array(""=>"Select Techer");
		if($rowsTeacher_sat_4_5) {
			foreach($rowsTeacher_sat_4_5 as $teacher_sat_4_5) $option_teacher_sat_4_5[$teacher_sat_4_5['teacher_id']]=$teacher_sat_4_5['teacher_name'];
		}
		$teacher_sat_4_5 = new Zend_Form_Element_Select("teacher_sat_4_5");
		$teacher_sat_4_5->setMultiOptions($option_teacher_sat_4_5);
		$teacher_sat_4_5->setValue(0);
		$teacher_sat_4_5->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsat45Filter();getSubjectSat45Filter();"));
		$this->addElement($teacher_sat_4_5);
		
		$rowsTeacher_sat_5_7= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=6
										  AND tadt.`time_id`=7');
		$option_teacher_sat_5_7 = array(""=>"Select Techer");
		if($rowsTeacher_sat_5_7) {
			foreach($rowsTeacher_sat_5_7 as $teacher_sat_5_7) $option_teacher_sat_5_7[$teacher_sat_5_7['teacher_id']]=$teacher_sat_5_7['teacher_name'];
		}
		$teacher_sat_5_7 = new Zend_Form_Element_Select("teacher_sat_5_7");
		$teacher_sat_5_7->setMultiOptions($option_teacher_sat_5_7);
		$teacher_sat_5_7->setValue(0);
		$teacher_sat_5_7->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsat57Filter();getSubjectSat578Filter();"));
		$this->addElement($teacher_sat_5_7);
		
		$rowsTeacher_sat_7_8_1= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=6
										  AND tadt.`time_id`=8');
		$option_teacher_sat_7_8_1 = array(""=>"Select Techer");
		if($rowsTeacher_sat_7_8_1) {
			foreach($rowsTeacher_sat_7_8_1 as $teacher_sat_7_8_1) $option_teacher_sat_7_8_1[$teacher_sat_7_8_1['teacher_id']]=$teacher_sat_7_8_1['teacher_name'];
		}
		$teacher_sat_7_8_1 = new Zend_Form_Element_Select("teacher_sat_7_8_1");
		$teacher_sat_7_8_1->setMultiOptions($option_teacher_sat_7_8_1);
		$teacher_sat_7_8_1->setValue(0);
		$teacher_sat_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsat781Filter();getSubjectSat781Filter();"));
		$this->addElement($teacher_sat_7_8_1);
		
		// sunday
		
		$rowsTeacher_sun_7_8= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=7
										  AND tadt.`time_id`=1');
		$option_teacher_sun_7_8 = array(""=>"Select Techer");
		if($rowsTeacher_sun_7_8) {
			foreach($rowsTeacher_sun_7_8 as $teacher_sun_7_8) $option_teacher_sun_7_8[$teacher_sun_7_8['teacher_id']]=$teacher_sun_7_8['teacher_name'];
		}
		$teacher_sun_7_8 = new Zend_Form_Element_Select("teacher_sun_7_8");
		$teacher_sun_7_8->setMultiOptions($option_teacher_sun_7_8);
		$teacher_sun_7_8->setValue(0);
		$teacher_sun_7_8->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsun78Filter();getSubjectSun78Filter();"));
		$this->addElement($teacher_sun_7_8);
		
		$rowsTeacher_sun_8_10= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=7
										  AND tadt.`time_id`=2');
		$option_teacher_sun_8_10 = array(""=>"Select Techer");
		if($rowsTeacher_sun_8_10) {
			foreach($rowsTeacher_sun_8_10 as $teacher_sun_8_10) $option_teacher_sun_8_10[$teacher_sun_8_10['teacher_id']]=$teacher_sun_8_10['teacher_name'];
		}
		$teacher_sun_8_10 = new Zend_Form_Element_Select("teacher_sun_8_10");
		$teacher_sun_8_10->setMultiOptions($option_teacher_sun_8_10);
		$teacher_sun_8_10->setValue(0);
		$teacher_sun_8_10->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsun810Filter();getSubjectSun810Filter();"));
		$this->addElement($teacher_sun_8_10);
		
		$rowsTeacher_sun_10_12= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=7
										  AND tadt.`time_id`=3');
		$option_teacher_sun_10_12 = array(""=>"Select Techer");
		if($rowsTeacher_sun_10_12) {
			foreach($rowsTeacher_sun_10_12 as $teacher_sun_10_12) $option_teacher_sun_10_12[$teacher_sun_10_12['teacher_id']]=$teacher_sun_10_12['teacher_name'];
		}
		$teacher_sun_10_12 = new Zend_Form_Element_Select("teacher_sun_10_12");
		$teacher_sun_10_12->setMultiOptions($option_teacher_sun_10_12);
		$teacher_sun_10_12->setValue(0);
		$teacher_sun_10_12->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsun1012Filter();getSubjectSun1012Filter();"));
		$this->addElement($teacher_sun_10_12);
		
		
		$rowsTeacher_sun_1_2= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=7
										  AND tadt.`time_id`=4');
		$option_teacher_sun_1_2 = array(""=>"Select Techer");
		if($rowsTeacher_sun_1_2) {
			foreach($rowsTeacher_sun_1_2 as $teacher_sun_1_2) $option_teacher_sun_1_2[$teacher_sun_1_2['teacher_id']]=$teacher_sun_1_2['teacher_name'];
		}
		$teacher_sun_1_2 = new Zend_Form_Element_Select("teacher_sun_1_2");
		$teacher_sun_1_2->setMultiOptions($option_teacher_sat_1_2);
		$teacher_sun_1_2->setValue(0);
		$teacher_sun_1_2->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsun12Filter();getSubjectSun12Filter();"));
		$this->addElement($teacher_sun_1_2);
		
		$rowsTeacher_sun_2_4= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=7
										  AND tadt.`time_id`=5');
		$option_teacher_sun_2_4 = array(""=>"Select Techer");
		if($rowsTeacher_sun_2_4) {
			foreach($rowsTeacher_sun_2_4 as $teacher_sun_2_4) $option_teacher_sun_2_4[$teacher_sun_2_4['teacher_id']]=$teacher_sun_2_4['teacher_name'];
		}
		$teacher_sun_2_4 = new Zend_Form_Element_Select("teacher_sun_2_4");
		$teacher_sun_2_4->setMultiOptions($option_teacher_sun_2_4);
		$teacher_sun_2_4->setValue(0);
		$teacher_sun_2_4->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsun24Filter();getSubjectSun24Filter();"));
		$this->addElement($teacher_sun_2_4);
		
		$rowsTeacher_sun_4_5= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=7
										  AND tadt.`time_id`=6');
		$option_teacher_sun_4_5 = array(""=>"Select Techer");
		if($rowsTeacher_sun_4_5) {
			foreach($rowsTeacher_sun_4_5 as $teacher_sun_4_5) $option_teacher_sun_4_5[$teacher_sun_4_5['teacher_id']]=$teacher_sun_4_5['teacher_name'];
		}
		$teacher_sun_4_5 = new Zend_Form_Element_Select("teacher_sun_4_5");
		$teacher_sun_4_5->setMultiOptions($option_teacher_sun_4_5);
		$teacher_sun_4_5->setValue(0);
		$teacher_sun_4_5->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsun45Filter();getSubjectSun45Filter();"));
		$this->addElement($teacher_sun_4_5);
		
		$rowsTeacher_sun_5_7= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=7
										  AND tadt.`time_id`=7');
		$option_teacher_sun_5_7 = array(""=>"Select Techer");
		if($rowsTeacher_sun_5_7) {
			foreach($rowsTeacher_sun_5_7 as $teacher_sun_5_7) $option_teacher_sun_5_7[$teacher_sun_5_7['teacher_id']]=$teacher_sun_5_7['teacher_name'];
		}
		$teacher_sun_5_7 = new Zend_Form_Element_Select("teacher_sun_5_7");
		$teacher_sun_5_7->setMultiOptions($option_teacher_sun_5_7);
		$teacher_sun_5_7->setValue(0);
		$teacher_sun_5_7->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsun57Filter();getSubjectSun57Filter();"));
		$this->addElement($teacher_sun_5_7);
		
		$rowsTeacher_sun_7_8_1= $db->getGlobalDb('SELECT
										  t.`teacher_id`,
										  t.`teacher_name`
										FROM
										  tbl_teacher AS t,
										  tbl_teach_in AS tin ,
										  tbl_teaching AS ti,
										  tbl_teacher_available_day_time AS tadt
										WHERE t.`teacher_id` = tin.`teacher_id`
										  AND tin.`dpt_id` = 5
										  AND t.`teacher_id`= ti.`teacher_id`
										  AND ti.`subject_id`=5
										  AND t.`teacher_id`=tadt.`t_id`
										  AND tadt.`day_id`=7
										  AND tadt.`time_id`=8');
		$option_teacher_sun_7_8_1 = array(""=>"Select Techer");
		if($rowsTeacher_sun_7_8_1) {
			foreach($rowsTeacher_sun_7_8_1 as $teacher_sun_7_8_1) $option_teacher_sun_7_8_1[$teacher_sun_7_8_1['teacher_id']]=$teacher_sun_7_8_1['teacher_name'];
		}
		$teacher_sun_7_8_1 = new Zend_Form_Element_Select("teacher_sun_7_8_1");
		$teacher_sun_7_8_1->setMultiOptions($option_teacher_sun_7_8_1);
		$teacher_sun_7_8_1->setValue(0);
		$teacher_sun_7_8_1->setAttribs(array("class"=>"form-control","onChange"=>"getTeacheExistsun781Filter();getSubjectSun781Filter();"));
		$this->addElement($teacher_sun_7_8_1);
		
		//Room
		//monday
		$room_mon_7_8 = new Zend_Form_Element_Select("room_mon_7_8");
		$room_mon_7_8->setMultiOptions($option_room);
		$room_mon_7_8->setValue(0);
		$room_mon_7_8->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_mon_7_8);
		
		$room_mon_8_10 = new Zend_Form_Element_Select("room_mon_8_10");
		$room_mon_8_10->setMultiOptions($option_room);
		$room_mon_8_10->setValue(0);
		$room_mon_8_10->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_mon_8_10);
		
		$room_mon_10_12 = new Zend_Form_Element_Select("room_mon_10_12");
		$room_mon_10_12->setMultiOptions($option_room);
		$room_mon_10_12->setValue(0);
		$room_mon_10_12->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_mon_10_12);
		
		$room_mon_1_2 = new Zend_Form_Element_Select("room_mon_1_2");
		$room_mon_1_2->setMultiOptions($option_room);
		$room_mon_1_2->setValue(0);
		$room_mon_1_2->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_mon_1_2);
		
		$room_mon_2_4 = new Zend_Form_Element_Select("room_mon_2_4");
		$room_mon_2_4->setMultiOptions($option_room);
		$room_mon_2_4->setValue(0);
		$room_mon_2_4->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_mon_2_4);
		
		$room_mon_4_5 = new Zend_Form_Element_Select("room_mon_4_5");
		$room_mon_4_5->setMultiOptions($option_room);
		$room_mon_4_5->setValue(0);
		$room_mon_4_5->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_mon_4_5);
		
		$room_mon_5_7 = new Zend_Form_Element_Select("room_mon_5_7");
		$room_mon_5_7->setMultiOptions($option_room);
		$room_mon_5_7->setValue(0);
		$room_mon_5_7->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_mon_5_7);
		
		$room_mon_7_8_1 = new Zend_Form_Element_Select("room_mon_7_8_1");
		$room_mon_7_8_1->setMultiOptions($option_room);
		$room_mon_7_8_1->setValue(0);
		$room_mon_7_8_1->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_mon_7_8_1);
		
		//turesday
		$room_tue_7_8 = new Zend_Form_Element_Select("room_tue_7_8");
		$room_tue_7_8->setMultiOptions($option_room);
		$room_tue_7_8->setValue(0);
		$room_tue_7_8->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_tue_7_8);
		
		$room_tue_8_10 = new Zend_Form_Element_Select("room_tue_8_10");
		$room_tue_8_10->setMultiOptions($option_room);
		$room_tue_8_10->setValue(0);
		$room_tue_8_10->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_tue_8_10);
		
		$room_tue_10_12 = new Zend_Form_Element_Select("room_tue_10_12");
		$room_tue_10_12->setMultiOptions($option_room);
		$room_tue_10_12->setValue(0);
		$room_tue_10_12->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_tue_10_12);
		
		$room_tue_1_2 = new Zend_Form_Element_Select("room_tue_1_2");
		$room_tue_1_2->setMultiOptions($option_room);
		$room_tue_1_2->setValue(0);
		$room_tue_1_2->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_tue_1_2);
		
		$room_tue_2_4 = new Zend_Form_Element_Select("room_tue_2_4");
		$room_tue_2_4->setMultiOptions($option_room);
		$room_tue_2_4->setValue(0);
		$room_tue_2_4->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_tue_2_4);
		
		$room_tue_4_5 = new Zend_Form_Element_Select("room_tue_4_5");
		$room_tue_4_5->setMultiOptions($option_room);
		$room_tue_4_5->setValue(0);
		$room_tue_4_5->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_tue_4_5);
		
		$room_tue_5_7 = new Zend_Form_Element_Select("room_tue_5_7");
		$room_tue_5_7->setMultiOptions($option_room);
		$room_tue_5_7->setValue(0);
		$room_tue_5_7->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_tue_5_7);
		
		$room_tue_7_8_1 = new Zend_Form_Element_Select("room_tue_7_8_1");
		$room_tue_7_8_1->setMultiOptions($option_room);
		$room_tue_7_8_1->setValue(0);
		$room_tue_7_8_1->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_tue_7_8_1);
		
		//wednesday
		
		$room_wed_7_8 = new Zend_Form_Element_Select("room_wed_7_8");
		$room_wed_7_8->setMultiOptions($option_room);
		$room_wed_7_8->setValue(0);
		$room_wed_7_8->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_wed_7_8);
		
		$room_wed_8_10 = new Zend_Form_Element_Select("room_wed_8_10");
		$room_wed_8_10->setMultiOptions($option_room);
		$room_wed_8_10->setValue(0);
		$room_wed_8_10->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_wed_8_10);
		
		$room_wed_10_12 = new Zend_Form_Element_Select("room_wed_10_12");
		$room_wed_10_12->setMultiOptions($option_room);
		$room_wed_10_12->setValue(0);
		$room_wed_10_12->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_wed_10_12);
		
		$room_wed_1_2 = new Zend_Form_Element_Select("room_wed_1_2");
		$room_wed_1_2->setMultiOptions($option_room);
		$room_wed_1_2->setValue(0);
		$room_wed_1_2->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_wed_1_2);
		
		$room_wed_2_4 = new Zend_Form_Element_Select("room_wed_2_4");
		$room_wed_2_4->setMultiOptions($option_room);
		$room_wed_2_4->setValue(0);
		$room_wed_2_4->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_wed_2_4);
		
		$room_wed_4_5 = new Zend_Form_Element_Select("room_wed_4_5");
		$room_wed_4_5->setMultiOptions($option_room);
		$room_wed_4_5->setValue(0);
		$room_wed_4_5->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_wed_4_5);
		
		$room_wed_5_7 = new Zend_Form_Element_Select("room_wed_5_7");
		$room_wed_5_7->setMultiOptions($option_room);
		$room_wed_5_7->setValue(0);
		$room_wed_5_7->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_wed_5_7);
		
		$room_wed_7_8_1 = new Zend_Form_Element_Select("room_wed_7_8_1");
		$room_wed_7_8_1->setMultiOptions($option_room);
		$room_wed_7_8_1->setValue(0);
		$room_wed_7_8_1->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_wed_7_8_1);
		
		// thurday
		
		$room_thu_7_8 = new Zend_Form_Element_Select("room_thu_7_8");
		$room_thu_7_8->setMultiOptions($option_room);
		$room_thu_7_8->setValue(0);
		$room_thu_7_8->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_thu_7_8);
		
		$room_thu_8_10 = new Zend_Form_Element_Select("room_thu_8_10");
		$room_thu_8_10->setMultiOptions($option_room);
		$room_thu_8_10->setValue(0);
		$room_thu_8_10->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_thu_8_10);
		
		$room_thu_10_12 = new Zend_Form_Element_Select("room_thu_10_12");
		$room_thu_10_12->setMultiOptions($option_room);
		$room_thu_10_12->setValue(0);
		$room_thu_10_12->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_thu_10_12);
		
		$room_thu_1_2 = new Zend_Form_Element_Select("room_thu_1_2");
		$room_thu_1_2->setMultiOptions($option_room);
		$room_thu_1_2->setValue(0);
		$room_thu_1_2->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_thu_1_2);
		
		$room_thu_2_4 = new Zend_Form_Element_Select("room_thu_2_4");
		$room_thu_2_4->setMultiOptions($option_room);
		$room_thu_2_4->setValue(0);
		$room_thu_2_4->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_thu_2_4);
		
		$room_thu_4_5 = new Zend_Form_Element_Select("room_thu_4_5");
		$room_thu_4_5->setMultiOptions($option_room);
		$room_thu_4_5->setValue(0);
		$room_thu_4_5->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_thu_4_5);
		
		$room_thu_5_7 = new Zend_Form_Element_Select("room_thu_5_7");
		$room_thu_5_7->setMultiOptions($option_room);
		$room_thu_5_7->setValue(0);
		$room_thu_5_7->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_thu_5_7);
		
		$room_thu_7_8_1 = new Zend_Form_Element_Select("room_thu_7_8_1");
		$room_thu_7_8_1->setMultiOptions($option_room);
		$room_thu_7_8_1->setValue(0);
		$room_thu_7_8_1->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_thu_7_8_1);
		
		//friday
		$room_fri_7_8 = new Zend_Form_Element_Select("room_fri_7_8");
		$room_fri_7_8->setMultiOptions($option_room);
		$room_fri_7_8->setValue(0);
		$room_fri_7_8->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_fri_7_8);
		
		$room_fri_8_10 = new Zend_Form_Element_Select("room_fri_8_10");
		$room_fri_8_10->setMultiOptions($option_room);
		$room_fri_8_10->setValue(0);
		$room_fri_8_10->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_fri_8_10);
		
		$room_fri_10_12 = new Zend_Form_Element_Select("room_fri_10_12");
		$room_fri_10_12->setMultiOptions($option_room);
		$room_fri_10_12->setValue(0);
		$room_fri_10_12->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_fri_10_12);
		
		$room_fri_1_2 = new Zend_Form_Element_Select("room_fri_1_2");
		$room_fri_1_2->setMultiOptions($option_room);
		$room_fri_1_2->setValue(0);
		$room_fri_1_2->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_fri_1_2);
		
		$room_fri_2_4 = new Zend_Form_Element_Select("room_fri_2_4");
		$room_fri_2_4->setMultiOptions($option_room);
		$room_fri_2_4->setValue(0);
		$room_fri_2_4->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_fri_2_4);
		
		$room_fri_4_5 = new Zend_Form_Element_Select("room_fri_4_5");
		$room_fri_4_5->setMultiOptions($option_room);
		$room_fri_4_5->setValue(0);
		$room_fri_4_5->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_fri_4_5);
		
		$room_fri_5_7 = new Zend_Form_Element_Select("room_fri_5_7");
		$room_fri_5_7->setMultiOptions($option_room);
		$room_fri_5_7->setValue(0);
		$room_fri_5_7->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_fri_5_7);
		
		$room_fri_7_8_1 = new Zend_Form_Element_Select("room_fri_7_8_1");
		$room_fri_7_8_1->setMultiOptions($option_room);
		$room_fri_7_8_1->setValue(0);
		$room_fri_7_8_1->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_fri_7_8_1);
		
		//saturday
		
		$room_sat_7_8 = new Zend_Form_Element_Select("room_sat_7_8");
		$room_sat_7_8->setMultiOptions($option_room);
		$room_sat_7_8->setValue(0);
		$room_sat_7_8->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sat_7_8);
		
		$room_sat_8_10 = new Zend_Form_Element_Select("room_sat_8_10");
		$room_sat_8_10->setMultiOptions($option_room);
		$room_sat_8_10->setValue(0);
		$room_sat_8_10->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sat_8_10);
		
		$room_sat_10_12 = new Zend_Form_Element_Select("room_sat_10_12");
		$room_sat_10_12->setMultiOptions($option_room);
		$room_sat_10_12->setValue(0);
		$room_sat_10_12->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sat_10_12);
		
		$room_sat_1_2 = new Zend_Form_Element_Select("room_sat_1_2");
		$room_sat_1_2->setMultiOptions($option_room);
		$room_sat_1_2->setValue(0);
		$room_sat_1_2->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sat_1_2);
		
		$room_sat_2_4 = new Zend_Form_Element_Select("room_sat_2_4");
		$room_sat_2_4->setMultiOptions($option_room);
		$room_sat_2_4->setValue(0);
		$room_sat_2_4->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sat_2_4);
		
		$room_sat_4_5 = new Zend_Form_Element_Select("room_sat_4_5");
		$room_sat_4_5->setMultiOptions($option_room);
		$room_sat_4_5->setValue(0);
		$room_sat_4_5->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sat_4_5);
		
		$room_sat_5_7 = new Zend_Form_Element_Select("room_sat_5_7");
		$room_sat_5_7->setMultiOptions($option_room);
		$room_sat_5_7->setValue(0);
		$room_sat_5_7->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sat_5_7);
		
		$room_sat_7_8_1 = new Zend_Form_Element_Select("room_sat_7_8_1");
		$room_sat_7_8_1->setMultiOptions($option_room);
		$room_sat_7_8_1->setValue(0);
		$room_sat_7_8_1->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sat_7_8_1);
		
		//sunday
		
		$room_sun_7_8 = new Zend_Form_Element_Select("room_sun_7_8");
		$room_sun_7_8->setMultiOptions($option_room);
		$room_sun_7_8->setValue(0);
		$room_sun_7_8->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sun_7_8);
		
		$room_sun_8_10 = new Zend_Form_Element_Select("room_sun_8_10");
		$room_sun_8_10->setMultiOptions($option_room);
		$room_sun_8_10->setValue(0);
		$room_sun_8_10->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sun_8_10);
		
		$room_sun_10_12 = new Zend_Form_Element_Select("room_sun_10_12");
		$room_sun_10_12->setMultiOptions($option_room);
		$room_sun_10_12->setValue(0);
		$room_sun_10_12->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sun_10_12);
		
		$room_sun_1_2 = new Zend_Form_Element_Select("room_sun_1_2");
		$room_sun_1_2->setMultiOptions($option_room);
		$room_sun_1_2->setValue(0);
		$room_sun_1_2->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sun_1_2);
		
		$room_sun_2_4 = new Zend_Form_Element_Select("room_sun_2_4");
		$room_sun_2_4->setMultiOptions($option_room);
		$room_sun_2_4->setValue(0);
		$room_sun_2_4->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sun_2_4);
		
		$room_sun_4_5 = new Zend_Form_Element_Select("room_sun_4_5");
		$room_sun_4_5->setMultiOptions($option_room);
		$room_sun_4_5->setValue(0);
		$room_sun_4_5->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sun_4_5);
		
		$room_sun_5_7 = new Zend_Form_Element_Select("room_sun_5_7");
		$room_sun_5_7->setMultiOptions($option_room);
		$room_sun_5_7->setValue(0);
		$room_sun_5_7->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sun_5_7);
		
		$room_sun_7_8_1 = new Zend_Form_Element_Select("room_sun_7_8_1");
		$room_sun_7_8_1->setMultiOptions($option_room);
		$room_sun_7_8_1->setValue(0);
		$room_sun_7_8_1->setAttribs(array("class"=>"form-control"));
		$this->addElement($room_sun_7_8_1);
		
		$valid_date = new Zend_Form_Element_Text("valid_date");
		$create_date = new Zend_Form_Element_Text("create_date");
		
		$rowsfac= $db->getGlobalDb('SELECT
									  f.`fac_name`,
									  f.`fac_id`
									FROM
									  tbl_faculty AS f
									WHERE f.`fac_name` != ""
									ORDER BY f.`fac_name` ASC ');
		$option_fac = array(""=>"--Please Select Faculty--");
		if($rowsfac) {
			foreach($rowsfac as $readfac) $option_fac[$readfac['fac_id']]=$readfac['fac_name'];
		}
		$fac = new Zend_Form_Element_Select("facuty");
		$fac->setMultiOptions($option_fac);
		$fac->setAttribs(array("class"=>"form-control"));
		$this->addElement($fac);
		
		$rowsDpt= $db->getGlobalDb('SELECT 
									  dpt.`dpt_id`,
									  dpt.`dpt_name`
									FROM
									  tbl_departments AS dpt,
									  tbl_faculty AS f
									WHERE dpt.`dpt_name` != "" 
									AND dpt.`fac_id`=f.`fac_id`
									ORDER BY dpt.`dpt_name` ASC  ');
		$option_dpt = array(""=>"--Please Select Department--");
		if($rowsDpt) {
			foreach($rowsDpt as $readdpt) $option_dpt[$readdpt['dpt_id']]=$readdpt['dpt_name'];
		}
		$dpt = new Zend_Form_Element_Select("deparment");
		$dpt->setMultiOptions($option_dpt);
		$dpt->setAttribs(array("class"=>"form-control","onChange"=>"getTeacherMon78Filter();getTeacherMon810Filter();getTeacherMon1012Filter();getTeacherMon12Filter();getTeacherMon24Filter();getTeacherMon45Filter();getTeacherMon57Filter();getTeacherMon781Filter();
														  getTeachertur78Filter();getTeachertur810Filter();getTeachertur1012Filter();getTeachertur12Filter();getTeachertur24Filter();getTeachertur45Filter();getTeachertur57Filter();getTeachertur781Filter();
														  getTeacherwed78Filter();getTeacherwed810Filter();getTeacherwed1012Filter();getTeacherwed12Filter();getTeacherwed24Filter();getTeacherwed45Filter();getTeacherwed57Filter();getTeacherwed781Filter();
														  getTeacherthu78Filter();getTeacherthu810Filter();getTeacherthu1012Filter();getTeacherthu12Filter();getTeacherthu24Filter();getTeacherthu45Filter();getTeacherthu57Filter();getTeacherthu781Filter();
														  getTeacherfri78Filter();getTeacherfri810Filter();getTeacherfri1012Filter();getTeacherfri12Filter();getTeacherfri24Filter();getTeacherfri45Filter();getTeacherfri57Filter();getTeacherfri781Filter();
														  getTeachersat78Filter();getTeachersat810Filter();getTeachersat1012Filter();getTeachersat12Filter();getTeachersat24Filter();getTeachersat45Filter();getTeachersat57Filter();getTeachersat781Filter();
														  getTeachersun78Filter();getTeachersun810Filter();getTeachersun1012Filter();getTeachersun12Filter();getTeachersun24Filter();getTeachersun45Filter();getTeachersun57Filter();getTeachersun781Filter();
							"));
		$this->addElement($dpt);
		
		$save = new Zend_Form_Element_Submit("save");
		$save->setAttribs(array("class"=>"btn btn-small btn-primary"));
		$this->addElement($save);
		
		$save_new = new Zend_Form_Element_Submit("save_new");
		$save_new->setAttribs(array("class"=>"btn btn-small btn-primary"));
		$this->addElement($save_new);
		
		$cancel = new Zend_Form_Element_Submit("cancel");
		$cancel->setAttribs(array("class"=>"btn btn-small btn-warning"));
		$this->addElement($cancel);
		
		$this->addElements(array($academic_year,$level,$year,$semester,$session,$room_pri,$valid_date,$create_date));
		
		if($formsche!=null){
		
			
			$fac->setValue($formsche["fac_id"]);
			$dpt->setValue($formsche["department_id"]);
			$level->setValue($formsche["degree"]);
			$academic_year->setValue($formsche["academic_year"]);
			$year->setValue($formsche["year_id"]);
			$semester->setValue($formsche["semester_id"]);
			$session->setValue($formsche["session_id"]);
			$room_pri->setValue($formsche["room_id"]);
			$status->setValue($formsche["status"]);
			$approve_date->setValue($formsche["due_date"]);
			$validDate->setValue($formsche["valid_date"]);
			$bath->setValue($formsche["batch"]);
			
			$room_mon_7_8->setValue($formsche["mon_7_8"]);
			$room_mon_8_10->setValue($formsche["mon_8_10"]);
			$room_mon_10_12->setValue($formsche["mon_10_12"]);
			$room_mon_1_2->setValue($formsche["mon_1_2"]);
			$room_mon_2_4->setValue($formsche["mon_2_4"]);
			$room_mon_4_5->setValue($formsche["mon_4_5"]);
			$room_mon_5_7->setValue($formsche["mon_5_7"]);
			$room_mon_7_8_1->setValue($formsche["mon_7_8_1"]);
			
			$room_tue_7_8->setValue($formsche["tur_7_8"]);
			$room_tue_8_10->setValue($formsche["tur_8_10"]);
			$room_tue_10_12->setValue($formsche["tur_10_12"]);
			$room_tue_1_2->setValue($formsche["tur_1_2"]);
			$room_tue_2_4->setValue($formsche["tur_2_4"]);
			$room_tue_4_5->setValue($formsche["tur_4_5"]);
			$room_tue_5_7->setValue($formsche["tur_5_7"]);
			$room_tue_7_8_1->setValue($formsche["tur_7_8_1"]);
			
			$room_wed_7_8->setValue($formsche["wed_7_8"]);
			$room_wed_8_10->setValue($formsche["wed_8_10"]);
			$room_wed_10_12->setValue($formsche["wed_10_12"]);
			$room_wed_1_2->setValue($formsche["wed_1_2"]);
			$room_wed_2_4->setValue($formsche["wed_2_4"]);
			$room_wed_4_5->setValue($formsche["wed_4_5"]);
			$room_wed_5_7->setValue($formsche["wed_5_7"]);
			$room_wed_7_8_1->setValue($formsche["wed_7_8_1"]);
			
			$room_thu_7_8->setValue($formsche["thu_7_8"]);
			$room_thu_8_10->setValue($formsche["thu_8_10"]);
			$room_thu_10_12->setValue($formsche["thu_10_12"]);
			$room_thu_1_2->setValue($formsche["thu_1_2"]);
			$room_thu_2_4->setValue($formsche["thu_2_4"]);
			$room_thu_4_5->setValue($formsche["thu_4_5"]);
			$room_thu_5_7->setValue($formsche["thu_5_7"]);
			$room_thu_7_8_1->setValue($formsche["thu_7_8_1"]);
			
			$room_fri_7_8->setValue($formsche["fri_7_8"]);
			$room_fri_8_10->setValue($formsche["fri_8_10"]);
			$room_fri_10_12->setValue($formsche["fri_10_12"]);
			$room_fri_1_2->setValue($formsche["fri_1_2"]);
			$room_fri_2_4->setValue($formsche["fri_2_4"]);
			$room_fri_4_5->setValue($formsche["fri_4_5"]);
			$room_fri_5_7->setValue($formsche["fri_5_7"]);
			$room_fri_7_8_1->setValue($formsche["fri_7_8_1"]);
			
			$room_sat_7_8->setValue($formsche["sat_7_8"]);
			$room_sat_8_10->setValue($formsche["sat_8_10"]);
			$room_sat_10_12->setValue($formsche["sat_10_12"]);
			$room_sat_1_2->setValue($formsche["sat_1_2"]);
			$room_sat_2_4->setValue($formsche["sat_2_4"]);
			$room_sat_4_5->setValue($formsche["sat_4_5"]);
			$room_sat_5_7->setValue($formsche["sat_5_7"]);
			$room_sat_7_8_1->setValue($formsche["sat_7_8_1"]);
			
			$room_sun_7_8->setValue($formsche["sun_7_8"]);
			$room_sun_8_10->setValue($formsche["sun_8_10"]);
			$room_sun_10_12->setValue($formsche["sun_10_12"]);
			$room_sun_1_2->setValue($formsche["sun_1_2"]);
			$room_sun_2_4->setValue($formsche["sun_2_4"]);
			$room_sun_4_5->setValue($formsche["sun_4_5"]);
			$room_sun_5_7->setValue($formsche["sun_5_7"]);
			$room_sun_7_8_1->setValue($formsche["sun_7_8_1"]);
			
			$subject_mon_7_8->setValue($formsche["smon78"]);
			$subject_mon_8_10->setValue($formsche["smon810"]);
			$subject_mon_10_12->setValue($formsche["smon1012"]);
			$subject_mon_1_2->setValue($formsche["smon12"]);
			$subject_mon_2_4->setValue($formsche["smon24"]);
			$subject_mon_4_5->setValue($formsche["smon45"]);
			$subject_mon_5_7->setValue($formsche["smon57"]);
			$subject_mon_7_8_1->setValue($formsche["smon781"]);
			
			$subject_tue_7_8->setValue($formsche["stur78"]);
			$subject_tue_8_10->setValue($formsche["stur810"]);
			$subject_tue_10_12->setValue($formsche["stur1012"]);
			$subject_tue_1_2->setValue($formsche["stur12"]);
			$subject_tue_2_4->setValue($formsche["stur24"]);
			$subject_tue_4_5->setValue($formsche["stur45"]);
			$subject_tue_5_7->setValue($formsche["stur57"]);
			$subject_tue_7_8_1->setValue($formsche["stur781"]);
			
			$subject_wed_7_8->setValue($formsche["swed78"]);
			$subject_wed_8_10->setValue($formsche["swed810"]);
			$subject_wed_10_12->setValue($formsche["swed1012"]);
			$subject_wed_1_2->setValue($formsche["swed12"]);
			$subject_wed_2_4->setValue($formsche["swed24"]);
			$subject_wed_4_5->setValue($formsche["swed45"]);
			$subject_wed_5_7->setValue($formsche["swed57"]);
			$subject_wed_7_8_1->setValue($formsche["swed781"]);
			
			$subject_thu_7_8->setValue($formsche["sthu78"]);
			$subject_thu_8_10->setValue($formsche["sthu810"]);
			$subject_thu_10_12->setValue($formsche["sthu1012"]);
			$subject_thu_1_2->setValue($formsche["sthu12"]);
			$subject_thu_2_4->setValue($formsche["sthu24"]);
			$subject_thu_4_5->setValue($formsche["sthu45"]);
			$subject_thu_5_7->setValue($formsche["sthu57"]);
			$subject_thu_7_8_1->setValue($formsche["sthu781"]);
			
			$subject_fri_7_8->setValue($formsche["sfri78"]);
			$subject_fri_8_10->setValue($formsche["sfri810"]);
			$subject_fri_10_12->setValue($formsche["sfri1012"]);
			$subject_fri_1_2->setValue($formsche["sfri12"]);
			$subject_fri_2_4->setValue($formsche["sfri24"]);
			$subject_fri_4_5->setValue($formsche["sfri45"]);
			$subject_fri_5_7->setValue($formsche["sfri57"]);
			$subject_fri_7_8_1->setValue($formsche["sfri781"]);
			
			$subject_sat_7_8->setValue($formsche["ssat78"]);
			$subject_sat_8_10->setValue($formsche["ssat810"]);
			$subject_sat_10_12->setValue($formsche["ssat1012"]);
			$subject_sat_1_2->setValue($formsche["ssat12"]);
			$subject_sat_2_4->setValue($formsche["ssat24"]);
			$subject_sat_4_5->setValue($formsche["ssat45"]);
			$subject_sat_5_7->setValue($formsche["ssat57"]);
			$subject_sat_7_8_1->setValue($formsche["ssat781"]);
			
			$subject_sun_7_8->setValue($formsche["ssun78"]);
			$subject_sun_8_10->setValue($formsche["ssun810"]);
			$subject_sun_10_12->setValue($formsche["ssun1012"]);
			$subject_sun_1_2->setValue($formsche["ssun12"]);
			$subject_sun_2_4->setValue($formsche["ssun24"]);
			$subject_sun_4_5->setValue($formsche["ssun45"]);
			$subject_sun_5_7->setValue($formsche["ssun57"]);
			$subject_sun_7_8_1->setValue($formsche["ssun781"]);
			
			//$teacher_mon_7_8->setValue($formsche["tmon78"]);
			$teacher_mon_8_10->setValue($formsche["tmon810"]);
			$teacher_mon_10_12->setValue($formsche["tmon1012"]);
			$teacher_mon_1_2->setValue($formsche["tmon12"]);
			$teacher_mon_2_4->setValue($formsche["tmon24"]);
			$teacher_mon_4_5->setValue($formsche["tmon45"]);
			$teacher_mon_5_7->setValue($formsche["tmon57"]);
			$teacher_mon_7_8_1->setValue($formsche["tmon781"]);
			
			$teacher_tur_7_8->setValue($formsche["ttur78"]);
			$teacher_tur_8_10->setValue($formsche["ttur810"]);
			$teacher_tur_10_12->setValue($formsche["ttur1012"]);
			$teacher_tur_1_2->setValue($formsche["ttur12"]);
			$teacher_tur_2_4->setValue($formsche["ttur24"]);
			$teacher_tur_4_5->setValue($formsche["ttur45"]);
			$teacher_tur_5_7->setValue($formsche["ttur57"]);
			$teacher_tur_7_8_1->setValue($formsche["ttur781"]);
			
			$teacher_wed_7_8->setValue($formsche["twed78"]);
			$teacher_wed_8_10->setValue($formsche["twed810"]);
			$teacher_wed_10_12->setValue($formsche["twed1012"]);
			$teacher_wed_1_2->setValue($formsche["twed12"]);
			$teacher_wed_2_4->setValue($formsche["twed24"]);
			$teacher_wed_4_5->setValue($formsche["twed45"]);
			$teacher_wed_5_7->setValue($formsche["twed57"]);
			$teacher_wed_7_8_1->setValue($formsche["twed781"]);
			
			$teacher_thu_7_8->setValue($formsche["tthu78"]);
			$teacher_thu_8_10->setValue($formsche["tthu810"]);
			$teacher_thu_10_12->setValue($formsche["tthu1012"]);
			$teacher_thu_1_2->setValue($formsche["tthu12"]);
			$teacher_thu_2_4->setValue($formsche["tthu24"]);
			$teacher_thu_4_5->setValue($formsche["tthu45"]);
			$teacher_thu_5_7->setValue($formsche["tthu57"]);
			$teacher_thu_7_8_1->setValue($formsche["tthu781"]);
			
			$teacher_fri_7_8->setValue($formsche["tfri78"]);
			$teacher_fri_8_10->setValue($formsche["tfri810"]);
			$teacher_fri_10_12->setValue($formsche["tfri1012"]);
			$teacher_fri_1_2->setValue($formsche["tfri12"]);
			$teacher_fri_2_4->setValue($formsche["tfri24"]);
			$teacher_fri_4_5->setValue($formsche["tfri45"]);
			$teacher_fri_5_7->setValue($formsche["tfri57"]);
			$teacher_fri_7_8_1->setValue($formsche["tfri781"]);
			
			$teacher_sat_7_8->setValue($formsche["tsat78"]);
			$teacher_sat_8_10->setValue($formsche["tsat810"]);
			$teacher_sat_10_12->setValue($formsche["tsat1012"]);
			$teacher_sat_1_2->setValue($formsche["tsat12"]);
			$teacher_sat_2_4->setValue($formsche["tsat24"]);
			$teacher_sat_4_5->setValue($formsche["tsat45"]);
			$teacher_sat_5_7->setValue($formsche["tsat57"]);
			$teacher_sat_7_8_1->setValue($formsche["tsat781"]);
			
			$teacher_sun_7_8->setValue($formsche["tsun78"]);
			$teacher_sun_8_10->setValue($formsche["tsun810"]);
			$teacher_sun_10_12->setValue($formsche["tsun1012"]);
			$teacher_sun_1_2->setValue($formsche["tsun12"]);
			$teacher_sun_2_4->setValue($formsche["tsun24"]);
			$teacher_sun_4_5->setValue($formsche["tsun45"]);
			$teacher_sun_5_7->setValue($formsche["tsun57"]);
			$teacher_sun_7_8_1->setValue($formsche["tsun781"]);
			
		}
		return $this;
	}

}

